package main

import (
	"flag"
	"fmt"
	"qiuya/core"
)

//go:generate go-bindata -fs -prefix "static/dist" -o=core/static.go -pkg=core static/dist/...

//func index(w http.ResponseWriter, r *http.Request) {
//	if r.Method != "GET" {
//		return
//	}
//
//	t, _ := template.ParseFiles("index.html")
//	t.Execute(w, nil)
//}

func main() {
	fmt.Println(`
                                ___                       ___     
      ___         ___          /__/\          ___        /  /\    
     /  /\       /  /\         \  \:\        /__/|      /  /::\   
    /  /::\     /  /:/          \  \:\      |  |:|     /  /:/\:\  
   /  /:/\:\   /__/::\      ___  \  \:\     |  |:|    /  /:/~/::\ 
  /  /:/~/::\  \__\/\:\__  /__/\  \__\:\  __|__|:|   /__/:/ /:/\:\
 /__/:/ /:/\:\    \  \:\/\ \  \:\ /  /:/ /__/::::\   \  \:\/:/__\/
 \  \:\/:/__\/     \__\::/  \  \:\  /:/     ~\~~\:\   \  \::/     
  \  \::/          /__/:/    \  \:\/:/        \  \:\   \  \:\     
   \__\/           \__\/      \  \::/          \__\/    \  \:\    
                               \__\/                     \__\/    
`)
	//var mp core.CollectionMap
	//var mp2 = mp
	//for i := range mp.Keys {
	//	log.Println(i)
	//}
	//log.Print(mp, mp2)
	flag.StringVar(&core.DBPath, "f", core.DBPath, "数据持久化路径")
	flag.IntVar(&core.Port, "p", core.Port, "监听端口")
	flag.IntVar(&core.ScanStep, "s", core.ScanStep, "日志检查间隔")
	flag.Uint64Var(&core.MaxLogSize, "max_log_size", core.MaxLogSize, "日志最大容量，超过该容量会触发一次全量备份")
	//flag.BoolVar(&core.Daemon, "d", false, "是否以后台模式运行")
	flag.Parse()

	core.InitQiuya(false)
}
